/*
	Copyright (C) 2013 Pontificia Universidad Catolica del Peru
	contact: http://avatar.inf.pucp.edu.pe/realidad-aumentada/
	address contact: Av. Universitaria 1801, San Miguel, Lima-Peru.
	
	This file is part of UbicAR PUCP.

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with This program.  If not, see <http://www.gnu.org/licenses/>.
*/
/*
	Authors: Alvaro Roger Agüero Sánchez, Rodolfo Javier Galvez Meza
	Pontificia Universidad Catolica del Peru
	Departamento de Ingeniería
*/

package org.grupoavatar.guiaubicua.auxiliares;

import org.grupoavatar.guiaubicua.mix.MixContext;
import org.grupoavatar.guiaubicua.mix.data.Servicios;

public class Servicio {
	
	public final static int INTERACCION_EMAIL = 0;
	public final static int INTERACCION_WEB = 1;
	public final static int INTERACCION_PRODUCTO = 2;
	public final static int INTERACCION_EVENTO = 3;
	
	private Servicios.DATASOURCE servicio;
	private String detalle;
	private int idInteraccion;
	private char tipoInteraccion;
	
	private Interaccion interaccion;
	
	public Servicio() {
		this.servicio = null;
		this.detalle = "Detalle";
		this.idInteraccion = 0;
		this.tipoInteraccion = 0;
	}
	
	public Servicio(Servicios.DATASOURCE servicio, String detalle, int interaccion, char tipoInteraccion) {
		this.servicio = servicio;
		this.detalle = detalle;
		this.idInteraccion = interaccion;
		this.tipoInteraccion = tipoInteraccion;
	}
	
	public String getDetalle(){
		return detalle;
	}
	
	public Servicios.DATASOURCE getServicio(){
		return servicio;
	}
	
	public String getNombre() {
		if (servicio != null)
			return MixContext.getServiceName(servicio);
		else
			return "";
	}
	
	public int getIdInteraccion() {
		return idInteraccion;
	}
	
	public char getTipoInteraccion() {
		return tipoInteraccion;
	}
	
	public int getIcono(){
		if (servicio != null)
			return MixContext.getServiceIcon(servicio);
		else
			return -1;
	}
	
	public void setInteraccion(Interaccion interaccion) {
		this.interaccion = interaccion;
	}
	
	public Interaccion getInteraccion() {
		return interaccion;
	}

	public void setTipoInteraccion(char tipo) {
		// TODO Auto-generated method stub
		this.tipoInteraccion = tipo;
	}
}
